{% extends base %}


{% block body_left %}

    {% include message/component/message_title.html %}

    {% init month_size = 0 %}

    <!-- Tab页 -->
    {% include message/component/message_tab_log.html %}

    {% include common/date/month_picker.html %}


    <div class="card">
        <a class="list-link" href="/message?tag=month_tags&date={{date}}&displayTag=date">
            <span>按标签查看</span>
            <div class="float-right">
                <span class="list-item-badge"></span>
                <i class="fa fa-chevron-right"></i>
            </div>
        </a>
        
        <a class="list-link" href="/message/calendar?date={{date}}">
            <span>按月查看</span>
            <div class="float-right">
                <span class="list-item-badge">{{ month_size }}</span>
                <i class="fa fa-chevron-right"></i>
            </div>
        </a>

    </div>
        
    <div class="card">
        {% if len(message_list) == 0 %}
            {% include common/text/empty_text.html %}
        {% end %}

        {% for folder in message_list %}
            <a href="/message?tag=log&p=date&p2=detail&date={{folder.date}}" class="list-link {{folder.css_class}}">
                <span>{{folder.title}}</span>
                <div class="float-right">
                    <span class="list-item-badge">{{ len(folder.item_list) }}</span>
                    <i class="fa fa-chevron-right"></i>
                </div>
            </a>
        {% end %}
    </div>

    <script type="text/javascript">
        $(function (e) {
            function onMonthSelected(event) {
                var date = event.target;
                var show_empty = getUrlParam("show_empty", "");
                window.location.href = "?date=" + date + "&show_empty=" + show_empty;
            }

            xnote.on("date.month.selected", onMonthSelected);
        })
    </script>

{% end %}

{% block body_right %}
    {% include message/component/message_date_right.html %}
{% end %}
